﻿using UnityEngine.UI;

public class WinDialog : Dialog {
    public Text title;

    protected override void Start()
    {
        base.Start();

        title.text = "LEVEL " + (Prefs.CurrentLevel + 1);

        if (Prefs.IsLastLevel())
        {
            Prefs.UnlockedLevel++;
        }
    }

    public void NextClick()
    {
        Close();
        Sound.instance.PlayButton();
        Prefs.CurrentLevel ++;

        CUtils.LoadScene(Prefs.CurrentLevel > Const.TOTAL_LEVEL - 1 ? 1 : 2, true);
    }

    public void MenuClick()
    {
        Close();
        Sound.instance.PlayButton();
        CUtils.LoadScene(1, true);
    }

    public void RateClick()
    {
        Sound.instance.PlayButton();
        CUtils.RateGame();
    }
}
